import Vue from 'vue'
import Router from 'vue-router'

import Login from '@/pages/user/login.vue'
import Regist from '@/pages/user/regist.vue'
import RegistTpl from '@/pages/user/registtpl.vue'
import Info from '@/pages/user/info.vue'
import InfoTpl from '@/pages/user/infotpl.vue'
import Information from '@/pages/information/index.vue'
import InformationDetail from '@/pages/information/detail.vue'
import Case from '@/pages/case/index.vue'
import CaseTpl from '@/pages/case/casetpl.vue'
import CaseDetail from '@/pages/case/detail.vue'
import caseReportDetail from '@/pages/case/opreportdetail.vue'
import CaseAdd from '@/pages/case/add.vue'
import CaseSearch from '@/pages/case/search.vue'
import CaseSelect from '@/pages/case/caseselect.vue'
import Ex from '@/pages/ex/index.vue'
import ExTpl from '@/pages/ex/extpl.vue'
import ExResult from '@/pages/ex/result.vue'
import CaseApply from '@/pages/case/apply.vue'
import OpReport from '@/pages/case/opreport.vue'
import ExChange from '@/pages/ex/exchange.vue'
import ExChangeTpl from '@/pages/ex/exchangetpl.vue'


Vue.use(Router)

const routes = [{
    name: 'login',
    path: '/login',
    component: Login,
    meta: {
        title: '登录',
        auth: true
    }
}, {
    name: 'regist',
    path: '/regist',
    component: Regist,
    meta: {
        title: '注册',
        auth: true
    }
}, {
    name: 'registtpl',
    path: '/registtpl',
    component: RegistTpl,
    meta: {
        title: '注册',
        auth: true
    }
}, {
    name: 'info',
    path: '/user/info',
    component: Info,
    meta: {
        title: '个人中心',
        auth: true
    }
}, {
    name: 'infotpl',
    path: '/user/infotpl',
    component: InfoTpl,
    meta: {
        title: '个人中心',
        auth: true
    }
}, {
    name: 'information',
    path: '/',
    component: Information,
    meta: {
        title: '学术资讯',
        auth: true
    }
}, {
    name: 'Detail',
    path: '/informationDetail/:aid',
    component: InformationDetail,
    meta: {
        title: '学术资讯',
        auth: true
    }
}, {
    name: 'apply',
    path: '/apply',
    component: CaseApply,
    meta: {
        title: '活动申请',
        auth: true
    }
}, {
    name: 'casetpl',
    path: '/casetpl',
    component: CaseTpl,
    meta: {
        title: '经典病例',
        auth: true
    }
}, {
    name: 'case',
    path: '/case',
    component: Case,
    meta: {
        title: '经典病例',
        auth: true
    }
}, {
    name: 'caseselect',
    path: '/caseselect',
    component: CaseSelect,
    meta: {
        title: '经典类型',
        auth: true
    }
}, {
    name: 'caseDetail',
    path: '/caseDetail/:id',
    component: CaseDetail,
    meta: {
        title: '经典详情',
        auth: true
    }
}, {
    name: 'caseReportDetail',
    path: '/caseReportDetail/:id',
    component: caseReportDetail,
    meta: {
        title: '经典详情',
        auth: true
    }
}, {
    name: 'caseAdd',
    path: '/caseAdd',
    component: CaseAdd,
    meta: {
        title: '病例登记',
        auth: true
    }
}, {
    name: 'caseSearch',
    path: '/caseSearch',
    component: CaseSearch,
    meta: {
        title: '病例搜索',
        auth: true
    }
}, {
    name: 'extpl',
    path: '/extpl',
    component: ExTpl,
    meta: {
        title: '在线答题',
        auth: true
    }
}, {
    name: 'ex',
    path: '/ex',
    component: Ex,
    meta: {
        title: '在线答题',
        auth: true
    }
}, {
    name: 'result',
    path: '/ex/result',
    component: ExResult,
    meta: {
        title: '答题结果',
        auth: true
    }
}, {
    name: 'report',
    path: '/case/report',
    component: OpReport,
    meta: {
        title: '术后镇痛病例征集表',
        auth: true
    }
}, {
    name: 'exchange',
    path: '/ex/change',
    component: ExChange,
    meta: {
        title: '商品兑换',
        auth: true
    }
}, {
    name: 'exchangetpl',
    path: '/ex/changetpl',
    component: ExChangeTpl,
    meta: {
        title: '商品兑换',
        auth: true
    }
}]

export default new Router({
    routes: routes
})